const secret = "6LePNl4fAAAAAFppUh_ycNqdEHHkP_dagm0cI72a"

const ins = (callback) => {
    window.grecaptcha.ready(() => {
        window.grecaptcha.execute(secret, {action: 'submit'}).then(token => {
            callback(token)
        });
    });
}

export function useReCaptcha() {
    return ins
}

export default {
    install:(app) => {
        app.config.globalProperties.reCaptcha = callback => {
            ins(callback)
        }
    }
}
